1  cd
    2  ll
    3  bash disk.sh 
    4  ll
    5  tmux new -s disk_test -d -n disk_test && tmux send -t disk_test " nice -n 19 bash /root/disk_test1-19.sh" ENTER
    6  lsblk
    7  lsblk | grep disk | wc
    8  killall dd
    9  df -h
   10  ll
   11  cd
   12  ll
   13  tmux ls
   14  tmux kill-session -t disk_test
   15  history 
   16  tmux new -s disk_test -d -n disk_test && tmux send -t disk_test " nice -n 19 bash /root/disk_test1-18.sh" ENTER
   17  df -h

#disk.sh
#!/bin/bash
export PATH=/bin:/sbin:/usr/bin:/usr/sbin

var=$(df -h | grep '/dev/sd' | awk '{print $1}' | head -1)
ex=${var##*/}
ex2=${ex%?}
host=$(ip ad | grep inet | grep -v 127.0.0.1 | grep -v inet6 | grep -oP 'inet \K\d+\.\d+\.\d+\.\d+')
num1=${host#*.}
num2=${num1#*.}
num=${num2//./-}

echo "Root device: $var"
echo "Device name: $ex"
echo "Base device: $ex2"

lsblk -d -o NAME,TYPE | grep disk | awk '{print $1}' > diskname.txt

for diskname in $(cat diskname.txt); do
    if [ "$ex2" != "$diskname" ]; then
        yes | parted /dev/$diskname mklabel gpt --script
        yes | parted /dev/$diskname mkpart primary xfs 0% 100% --script
        sleep 1
        mkfs.xfs -f -b size=4k /dev/${diskname}1
        mkdir -p /lotus-data/store-${num}-${diskname}1
        mount -t xfs /dev/${diskname}1 /lotus-data/store-${num}-${diskname}1/ -o noatime,nodiratime,largeio
        sleep 1
        uuid=$(blkid -s UUID -o value /dev/${diskname}1)
        echo UUID=$uuid /lotus-data/store-${num}-${diskname}1 xfs noatime,nodiratime,largeio 0 0 | sudo tee -a /etc/fstab
    fi
done

echo -e "\n\n***** Partitioning and mounting completed *****\n\n"


#disk_test1-19.sh
#!/bin/bash
export PATHi=/bin:/sbin:/usr/bin:/usr/sbin
var=$(df -h | grep '/dev/sd' | awk '{print $1}'|head -1)
ex=${var##*/}
ex2=${ex%?}
host=$(ip ad |grep inet|grep -v 127.0.0.1|grep -v inet6|grep -oP 'inet \K\d+\.\d+\.\d+\.\d+')
num1=${host#*.}
num2=${num1#*.}
num=${num2//./-}
echo $var
echo $ex
echo $ex2
lsblk | grep disk | awk '{print $1}' > diskname.txt
head -n 19 diskname.txt > disk
for disk in `cat /root/disk`
do
     var2=$(lsblk | grep ${disk} | grep disk | awk '{print $4}' | tail -c 2 )
     if [ "$ex2" != "$disk" ];then
     seq 446 |xargs -i dd if=/dev/zero of=/lotus-data/store-${num}-${disk}1/test{}.mp4 bs=32G count=16 &
        sleep 1
     fi
done;


#disk_test1-18.sh
#!/bin/bash
export PATHi=/bin:/sbin:/usr/bin:/usr/sbin
var=$(df -h | grep '/dev/sd' | awk '{print $1}'|head -1)
ex=${var##*/}
ex2=${ex%?}
host=$(ip ad |grep inet|grep -v 127.0.0.1|grep -v inet6|grep -oP 'inet \K\d+\.\d+\.\d+\.\d+')
num1=${host#*.}
num2=${num1#*.}
num=${num2//./-}
echo $var
echo $ex
echo $ex2
lsblk | grep disk | awk '{print $1}' > diskname.txt
tail -n 18 diskname.txt > disk
for disk in `cat /root/disk`
do
     var2=$(lsblk | grep ${disk} | grep disk | awk '{print $4}' | tail -c 2 )
     if [ "$ex2" != "$disk" ];then
     seq 446 |xargs -i dd if=/dev/zero of=/lotus-data/store-${num}-${disk}1/test{}.mp4 bs=32G count=16 &
        sleep 1
     fi
done;
